/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package core.crypto.integrity.p2m;

import java.io.File;
import java.io.FilenameFilter;
import java.util.regex.Pattern;

/**
 *
 * @author Vinicius
 */
public class P2mSoonFilesFilter implements FilenameFilter{

    private Pattern pattern;
    private String  baseName;

    public P2mSoonFilesFilter(Pattern pattern,String baseName){
        this.pattern = pattern;
        this.baseName = baseName;
    }

    @Override
    public boolean accept(File dir, String name) {
        return name.startsWith(baseName) && pattern.matcher(name).matches();
    }

}
